/**
 * 
 */
package com.base.myproject.client.ui;

import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.TableData;
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

/**
 * 查询参数界面
 * @author zgw
 *2009-8-26 下午02:16:50
 * javazgw@gmail.com
 */
public class QueryParamPanel extends ContentPanel{

	int colnum = 2;
	public QueryParamPanel(int colnum)
	{
		this.colnum = colnum;
		init();
		
	}
	void init()
	{
		setHeaderVisible(false);
		setLayout(new TableLayout(colnum));
	}
	public void addWidget(String name,Widget w)
	{
		TableData td = new TableData();
		Label l = new Label(name+":");
		add(l,td);
		add(w,td);
	}
	public void addQueryButton(SelectionListener<ButtonEvent> listener)
	{
		Button query = new Button("查询");
		query.addSelectionListener(listener);
		add(query);
		
		this.setBodyBorder(true);
	}
}
